using Microsoft.Phone.Controls;
using System;
using System.Windows;
namespace Coding4Fun.Phone.Controls.Toolkit.Binding
{
	public class DependencyObjectBinding
	{
		public static readonly DependencyProperty CancelGestureListenerBubbleProperty = DependencyProperty.RegisterAttached("CancelGestureListenerBubble", typeof(bool), typeof(DependencyObjectBinding), new PropertyMetadata(false, new PropertyChangedCallback(DependencyObjectBinding.OnCancelGestureListenerBubbleChanged)));
		public static bool GetCancelGestureListenerBubble(DependencyObject dependencyObject_0)
		{
			return (bool)dependencyObject_0.GetValue(DependencyObjectBinding.CancelGestureListenerBubbleProperty);
		}
		public static void SetCancelGestureListenerBubble(DependencyObject dependencyObject_0, bool value)
		{
			dependencyObject_0.SetValue(DependencyObjectBinding.CancelGestureListenerBubbleProperty, value);
		}
		private static void OnCancelGestureListenerBubbleChanged(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			if (dependencyPropertyChangedEventArgs_0.get_NewValue() == dependencyPropertyChangedEventArgs_0.get_OldValue())
			{
				return;
			}
			DependencyObjectBinding.smethod_0(dependencyObject_0, (bool)dependencyPropertyChangedEventArgs_0.get_NewValue());
		}
		private static void smethod_0(object object_0, bool bool_0)
		{
			DependencyObject dependencyObject = object_0 as DependencyObject;
			if (dependencyObject == null)
			{
				return;
			}
			GestureListener gestureListener = GestureService.GetGestureListener(dependencyObject);
			if (bool_0)
			{
				gestureListener.DoubleTap += new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.DragCompleted += new EventHandler<DragCompletedGestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.DragDelta += new EventHandler<DragDeltaGestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.DragStarted += new EventHandler<DragStartedGestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.Flick += new EventHandler<FlickGestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.GestureBegin += new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.GestureCompleted += new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.Hold += new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.PinchCompleted += new EventHandler<PinchGestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.PinchDelta += new EventHandler<PinchGestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.PinchStarted += new EventHandler<PinchStartedGestureEventArgs>(DependencyObjectBinding.smethod_1);
				gestureListener.Tap += new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
				return;
			}
			gestureListener.DoubleTap -= new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.DragCompleted -= new EventHandler<DragCompletedGestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.DragDelta -= new EventHandler<DragDeltaGestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.DragStarted -= new EventHandler<DragStartedGestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.Flick -= new EventHandler<FlickGestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.GestureBegin -= new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.GestureCompleted -= new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.Hold -= new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.PinchCompleted -= new EventHandler<PinchGestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.PinchDelta -= new EventHandler<PinchGestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.PinchStarted -= new EventHandler<PinchStartedGestureEventArgs>(DependencyObjectBinding.smethod_1);
			gestureListener.Tap -= new EventHandler<GestureEventArgs>(DependencyObjectBinding.smethod_1);
		}
		private static void smethod_1(object sender, GestureEventArgs e)
		{
			e.Handled = true;
		}
	}
}
